package com.feihong.txgw.tx_model;

import com.feihong.txgw.inter.contract.order.IOrderContract;
import com.feihong.txgw.json.user.AllOrderInfo;
import com.feihong.txgw.model.base_bean.BaseResponse;
import com.feihong.txgw.utils.helper.RxHelper;
import com.feihong.txgw.utils.manage.RetrofitManager;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName OrderMainModel
 * @package com.feihong.txgw.tx_model
 * @data 2018/5/7 10:38
 * @Describe
 * @Change
 */
public class OrderMainModel implements IOrderContract.IOrderMainModel {

    public static OrderMainModel create(){
        return new OrderMainModel();
    }
    @Override
    public Observable<AllOrderInfo> getOrderInfo(String pageNum, int orderStatus) {
        return RetrofitManager.getInstance().getOrderInfo("15",pageNum,String.valueOf(orderStatus)).compose(RxHelper.<AllOrderInfo>rxSchedulerHelper());
    }

    @Override
    public Observable<BaseResponse> orderOpration(String url, String orderSn, String orderType) {
        return RetrofitManager.getInstance().operateOrder(url,orderSn,orderType).compose(RxHelper.<BaseResponse>rxSchedulerHelper());
    }

}
